﻿Imports Microsoft.Reporting.WebForms
Public Class ReporteEquipoPC
    Inherits System.Web.UI.Page

    Dim strNOMBRE As String

    Private Sub principal(ByVal strNOMBRE As String)
        Me.ReportViewer1.LocalReport.ReportPath = ("reportes\ReporteEquiposPC.rdlc")
        Me.ReportViewer1.LocalReport.DataSources.Clear()

        Dim adapter As New DataSetTableAdapters.USP_CONSULTA_TB_EQUIPO_X_PCTableAdapter
        Dim table As New DataSet.USP_CONSULTA_TB_EQUIPO_X_PCDataTable

        'adapter.FillTb_Equipo(table, strIP, strMAC, strNombre)
        'adapter.FillTb_Equipo(table, strIP, strMAC)
        adapter.FillX_PC(table, strNOMBRE)

        Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", CType(table, DataTable)))
        Me.ReportViewer1.DataBind()
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnConsultar_Click(sender As Object, e As EventArgs) Handles btnConsultar.Click
        If txtNombre.Text.Length = 0 Then
            strNOMBRE = Nothing
        Else
            strNOMBRE = txtNombre.Text
        End If
        principal(strNOMBRE)
    End Sub
End Class